<div class="w1100 mt_10">
    <div class="mp">
        <div class="mp_img"><img src="<?php if(empty($user['headurl'])) print 'images/touxiang_img.jpg'; else print base_url().'uploads/'.$user['headurl'];?>" /></div>
        <div class="mp_cnt">
            <h3 class="mp_name fontc01"><?php echo $user['realname'];?></h3>
            <div class="mp_touxian">
                <?php echo $icon;?>
                <!--如果已经赞过，添加zan_has样式-->
                <?php
                    $id = isset($_GET['id']) ? $_GET['id'] : 0;
                    if($id){
                        if($zan){
                            echo '<a class="zan zan_has" id="zan"  href="javascript:void(0)"></a>';

                        }else{
                            echo '<a class="zan" id="zan" onclick="zan('.$id.',this)" href="javascript:void(0)"></a>';

                        }
                    }

                ?>
            </div>
            <span class="mp_renqi fontc01">赞：<?php echo $user['supportCount']?></span>
            <span class="mp_renqi fontc01">人气：<?php echo $user['pvcount']?></span>
            <div class="clear"></div>
            <div class="mp_age"><span class="fontc01"><?php echo $user['age'];?>岁</span>&nbsp;&nbsp;&nbsp;<?php echo $user['provincename'].'-'.$user['cityname'];?></div>
            <div class="mp_job"><?php echo $user['modeltypename']?></div>
            <ul class="mp_body">
                <li><span class="fontc01">身高：</span><?php echo $user['high'];?>CM</li>
                <li><span class="fontc01">体重：</span><?php echo $user['weight'];?>KG</li>
                <li><span class="fontc01">三围：</span><?php echo $user['chestsize'];?> / <?php echo $user['waistsize'];?> / <?php echo $user['buttsize'];?></li>
            </ul>
        </div>
        <div class="mp_2wei"><img src="<?php if(empty($user['codeimg'])) print 'images/2wei.jpg'; else print base_url().'imgCode/'.$user['codeimg'];?>" /></div>
    </div>
</div>
<script type="text/javascript">
    function zan(Id,obj){
        if(!Id){
            alert('参数错误');
            return ;
        }

        $.ajax({
            type: "post",
            url: "index.php/login/ajaxSupport",
            dataType: "json",
            data:{id:Id},
            async: false,
            success: function (data) {
                if(data.statusCode != 1){
                    alert(data.msg);
                }else{
                    $(obj).addClass("zan_has");
                    alert(data.msg);
                }
            }
        });

    }
</script>